#include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
const int N = 1e6;
vector<int> vis(N, 0);
int n, q;
vector<int> a;
vector<int> ans(N, 0);
bool solve(int Q)
{
	if (ans[Q]) {
		return true;
	}
	return false;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> q;
	a.resize(n);
	for (int i = 0; i < n; i++) cin >> a[i], vis[a[i]]++;
	sort(a.begin(), a.end());
	for (int i = 0; i < n; i++)
	{
		if (i && a[i] == a[i - 1]) {
			continue;
		}
		for (int j = a[i]; j <= a[n - 1]; j += a[i])
		{
			if (j == a[i]) {
				if (vis[j] >= 2) {
					ans[1] = 1;
				}
			}
			else {
				if (vis[j]) {
					ans[j / a[i]] = 1;
				}
			}
		}
	}
	while (q--)
	{
		int Q;
		cin >> Q;
		if (solve(Q)) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}

	}
	return 0;
}